/**
 * 
 */
package com.chh.mysso.web.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.chh.mysso.core.service.AuthUserService;
import com.chh.mysso.domain.model.dto.AuthUserDTO;
import com.chh.mysso.domain.pojo.command.user.AddAuthUserRequest;
import com.chh.mysso.domain.pojo.qo.AuthUserQo;

/**
 * @author chh
 *
 */
@Controller
@RequestMapping("/mysso/user")
public class AuthUserController extends BaseController{

	@Autowired
	private AuthUserService authUserService;
	
	@RequestMapping("/list")
	public String query(Model model, AuthUserQo qo){
		List<AuthUserDTO> list = authUserService.query(qo);
		model.addAttribute("list", list);
		return "user/list.html";
	}
	
	/**
	 * 保存新增用户
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping("/save")
	@ResponseBody
	public String save(AddAuthUserRequest request){
		return "success";
	}
	
	/**
	 * 跳转用户新增页面
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping("/add")
	public String add(HttpServletRequest request){
		return "/user/add.html";
	}
}
